
#ifndef ESP32_COM_H
#define ESP32_COM_H

#define LVGL_IS_ENABLE 1

//===============================
#define HAL_BUTTON_1     4
#define HAL_BUTTON_2     16
#define HAL_BUTTON_3     17
#define HAL_BUTTON_4     19

//===============================
#define ST7789_MOSI      23
#define ST7789_MISO      -1
#define ST7789_SCK       18
#define ST7789_CS        5
#define ST7789_DC        22
#define ST7789_RST       25
#define ST7789_BL        21
#define ST7789_SPI       VSPI
#define ST7789_WIDTH     240
#define ST7789_HIGHT     280
#define ST7789_ROTATION  1

//===============================
void esp32_hal_init(void);
void esp32_hal_loop(void);

typedef void (*CallbackFunction) (int key);
void esp32_key_pcb(CallbackFunction f);
void esp32_key_rcb(CallbackFunction f);

#if LVGL_IS_ENABLE
#include <lvgl.h>
void esp32_display_init(void);
void esp32_display_loop(void);
#endif

#endif /*ESP32_COM_H*/
